package com.baizhi.service.impl;

import com.baizhi.entity.Admin;
import com.baizhi.mapper.AdminMapper;
import com.baizhi.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("adminService")
@Transactional
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper mapper;
    @Override
    public boolean login(Admin admin) {
        Admin admin1=mapper.selectAdminByName(admin.getUsername());
        if(admin1!=null&&admin1.getPassword().equals(admin.getPassword())){
            return true;
        }
        return false;
    }
}
